package com.bw.biz;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.bw.core.utils.IdWorker;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import tk.mybatis.spring.annotation.MapperScan;

@SpringBootApplication
@EnableEurekaClient
@EnableDiscoveryClient
@EnableFeignClients
@MapperScan("com.bw.biz.mapper")
public class CreditBizWebServerAPP {
    public static void main(String[] args) {
        SpringApplication.run(CreditBizWebServerAPP.class);
    }

    @Bean
    public Snowflake getSnowflake(){
        return IdUtil.getSnowflake(2, 5);
    }
    @Bean
    public IdWorker idWorker(){
        return new IdWorker();
    }
}